<%--
  - Author		:	Jaewon Choi
  - Date			:
  - Description	:	
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirScripts}/jqueryUi/css/ui-lightness/jquery-ui-1.8.21.custom.css" />" />
		
		<style type="text/css">
			
		</style>
		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-ui-1.8.21.custom.min.js" />"></script>
		<script type="text/javascript">
			$(function() {
				$( ".date" ).datepicker({
					showOn: "both",
					buttonImage: "<c:url value="${dirImages}/calendar.png" />",
					buttonImageOnly: true,
					dateFormat: "yy-mm-dd"
				});
			});
			function goAction(id){
				if(id == "" || ! id){
					return false;
				}
				document.frm.id.value= id;
				document.frm.submit();
			}
			
			function goPage(page){
				document.searchFrm.page.value = page;
				document.searchFrm.submit();
			}
		</script>
	</head>
	<body>
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
		<div class="contWrap">
			<div class="menuTitle">프로토콜 통계</div>
			<form name="searchFrm" action="<c:url value="/logging/protocolVer.do" />" method="post">
				<input type="hidden" name="maxnum" value="${maxnum}" />
				<input type="hidden" name="page" value="${page}" />
				<table style="border: 0;">
					<tr>
						<td>조회기간</td>
						<td>
							<input type="text" class="date" name="startDate" readonly="readonly" value="${param.startDate}" /> ~ <input type="text" class="date" name="endDate" readonly="readonly" value="${param.endDate}" />
						</td>
					</tr>
					<tr>
						<td>카테고리</td>
						<td>
							<select name="categoryId">
								<option value="" <c:if test="${empty param.categoryId}"> selected="selected" </c:if> >전체</option>
								<c:forEach items="${categoryList}" var="category">
									<option value="${category.id}" <c:if test="${category.id eq param.categoryId}"> selected="selected" </c:if> >${category.name}</option>
								</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="2"><input type="submit" value="검색" /></td>
					</tr>
				</table>
			</form>
			<table class="tbl" border="1" style="width: 100%;" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="70px;" />
					<col width="*" />
					<col width="*" />
					<col width="*" />
					<col width="*" />
					<col width="*" />
					<col width="*" />
				</colgroup>
				<thead>
					<tr>
						<th>No.</th>
						<th>프로토콜 버전</th>
						<th>사용횟수</th>
						<th>사용시간</th>
						<th>스크랩 사용횟수</th>
						<th>이메일 사용횟수</th>
						<th>트위터 사용횟수</th>
						<th>페이스북 사용횟수</th>
					</tr>
				</thead>
				<tbody>
					<c:choose>
						<c:when test="${fn:length(loggingList) ne 0}">
							<c:forEach items="${loggingList}" var="logging" varStatus="loggingStat">
								<tr>
									<td style="text-align: center;">${fn:length(loggingList)-loggingStat.index}</td>
									<td style="text-align: center;">${logging.VERSION}</td>
									<td style="text-align: center;">${logging.VIEWCNT}</td>
									<td style="text-align: center;">${logging.VIEWTIME}</td>
									<td style="text-align: center;">${logging.SCRAPCNT}</td>
									<td style="text-align: center;">${logging.EMAILCNT}</td>
									<td style="text-align: center;">${logging.TWITTERCNT}</td>
									<td style="text-align: center;">${logging.FACEBOOKCNT}</td>
								</tr>
							</c:forEach>
						</c:when>
						<c:otherwise>
							<tr><td colspan="8" style="text-align: center;">데이터가 없습니다.</td></tr>
						</c:otherwise>
					</c:choose>
				</tbody>
			</table>
		</div>
<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
	</body>
</html> 